<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCaseCustomfieldsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('case_customfields', function (Blueprint $table) {
            $table->increments('id');
            $table->string('model')->default('')->comment('所属模块');
            $table->string('name')->default('')->comment('字段名称');
            $table->string('field')->unique()->default('')->comment('字段标识');
            $table->string('type')->default('')->comment('字段类型');
            $table->boolean('required')->comment('是否必填');
            $table->boolean('iflist')->comment('列表显示');
            $table->string('default')->nullable()->comment('默认值');
            $table->string('help')->nullable()->comment('提示信息');
            $table->json('options')->nullable()->comment('选项值');
            $table->boolean('unique')->comment('是否唯一');
            $table->boolean('show')->comment('启用');
            $table->integer('sort')->default('1')->comment('排序');
            $table->string('icon')->nullable()->comment('图标');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('case_customfields');
    }
}
